/**-----------------------------------------------------------------
 ** @file fss.common.FileImplementation.java
 **
 ** @brief This file implement the File Implementation which will be the
 ** object that return every time execute() is invoked within the command.
 **
 ** This class contains the byte array of the actual file transfer along
 ** with other needed information such as rmiId of the source of the remote
 ** object. More can be added later.
 **
 ** @author Meagan Griffin, Hieu Nguyen
 ** @created Mar 12, 2011 at 4:24:50 PM
 **
 ** @version 1.0
 **-----------------------------------------------------------------
 */
package fss.common;

/**
 *
 * @author hieu
 */
public class FileImplementation
{

  public FileImplementation(int aRmiId)
  {

  }
  
  /**
   * Return the end index of the the file transfer
   * @return int
   */
  public int getEndIndex()
  {
    return endIndex;
  }

  /**
   * Set the end index of the file transfer
   * @param endIndex
   */
  public void setEndIndex(int endIndex)
  {
    this.endIndex = endIndex;
  }

  /**
   * Return the file size in bytes
   * @return int
   */
  public int getFileSizeInBytes()
  {
    return fileSizeInBytes;
  }

  /**
   * Set the file size in byte
   * @param fileSizeInBytes
   */
  public void setFileSizeInBytes(int fileSizeInBytes)
  {
    this.fileSizeInBytes = fileSizeInBytes;
  }

  /**
   * Return the unique RMI identifier
   * @return
   */
  public int getRmiId()
  {
    return rmiId;
  }

  /**
   * Set the unique RMI identifier
   * @param rmiId int
   */
  public void setRmiId(int rmiId)
  {
    this.rmiId = rmiId;
  }

  /**
   * Serialized file in byte arrays
   * @return byte[]
   */
  public byte[] getSerializedFile()
  {
    return serializedFile;
  }

  /**
   * Set the serialized file in byte arrays
   * @param serializedFile byte[]
   */
  public void setSerializedFile(byte[] serializedFile)
  {
    this.serializedFile = serializedFile;
  }

  /**
   * Return the start index of the file transfer
   * @return int
   */
  public int getStartIndex()
  {
    return startIndex;
  }

  /**
   * Set the start index of the file transfer
   * @param startIndex int
   */
  public void setStartIndex(int startIndex)
  {
    this.startIndex = startIndex;
  }


  /**
   * This is the RMI Id of whoever sending out the command.
   */
  private int rmiId;

  /**
   * This is the total size of the file in bytes.
   */
  private int fileSizeInBytes;
  
  /**
   * This is the start index of the serialized file transfer
   */
  private int startIndex;
  
  /**
   * This is the end index of the serialized file transfer
   */
  private int endIndex;

  /**
   * The is the serialized file transfer.
   */
  private byte[] serializedFile;
}
